//
//  YFLlittleTableViewCell.m
//  Music
//
//  Created by dllo on 16/6/8.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "YFLlittleTableViewCell.h"

@implementation YFLlittleTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.songNameLabel =[[UILabel alloc]init];
        //self.songNameLabel.backgroundColor =[UIColor orangeColor];
        self.songNameLabel.font =[UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.songNameLabel];
        
        
        self.singerNameLabel =[[UILabel alloc]init];
       //self.singerNameLabel.backgroundColor =[UIColor redColor];
       // self.singerNameLabel.font =[UIFont systemFontOfSize:11];
        self.singerNameLabel.adjustsFontSizeToFitWidth = YES;
        [self.contentView addSubview:self.singerNameLabel];
        
        
        self.kindNameLabel =[[UILabel alloc]init];
        //self.kindNameLabel.backgroundColor =[UIColor purpleColor];
        self.kindNameLabel.font =[UIFont systemFontOfSize:12];
       
        [self.contentView addSubview:self.kindNameLabel];
        
        
        self.allasNameLabel =[[UILabel alloc]init];
        //self.allasNameLabel.backgroundColor =[UIColor cyanColor];
        self.allasNameLabel.font =[UIFont systemFontOfSize:11];
        [self.contentView addSubview:self.allasNameLabel];
    }
    return self;
}



-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.songNameLabel.frame = CGRectMake(40, 10, 100, 30);
    
    
    
    self.singerNameLabel.frame = CGRectMake(self.songNameLabel.frame.origin.x, self.songNameLabel.frame.origin.y+self.songNameLabel.frame.size.height+5, self.songNameLabel.frame.size.width/2, self.songNameLabel.frame.size.height);
    self.kindNameLabel.frame = CGRectMake(self.singerNameLabel.frame.origin.x+self.singerNameLabel.frame.size.width, self.singerNameLabel.frame.origin.y+2, self.singerNameLabel.frame.size.width*2, self.singerNameLabel.frame.size.height);
    
    self.allasNameLabel.frame = CGRectMake(self.songNameLabel.frame.origin.x+self.songNameLabel.frame.size.width+5, self.songNameLabel.frame.origin.y, self.songNameLabel.frame.size.width*2, self.songNameLabel.frame.size.height);
    
}
-(void)setDataModel:(NianFeilongModel *)DataModel
{
    if (_DataModel != DataModel) {
        _DataModel = DataModel;
        self.songNameLabel.text = DataModel.name;
        self.singerNameLabel.text =[NSString stringWithFormat:@"%@ -",DataModel.singerName];
        self.kindNameLabel.text = DataModel.albumName;
        self.allasNameLabel.text = DataModel.alias;
    }
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
